package com.luych.toolbox.docker.service.sdk.container.model;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

public class DockerContainersResult extends ArrayList<DockerContainersResult.Container> {
    public static class Container {

        @JsonProperty("Status")
        private String status;

        @JsonProperty("Mounts")
        private List<Mount> mounts;

        @JsonProperty("SizeRw")
        private Long sizeRw;

        @JsonProperty("Ports")
        private List<Port> ports;

        @JsonProperty("Labels")
        private Map<String, String> labels;

        @JsonProperty("Image")
        private String image;

        @JsonProperty("Created")
        private Long created;

        @JsonProperty("Names")
        private List<String> names;

        @JsonProperty("NetworkSettings")
        private NetworkSettings networkSettings;

        @JsonProperty("SizeRootFs")
        private Long sizeRootFs;

        @JsonProperty("Command")
        private String command;

        @JsonProperty("State")
        private String state;

        @JsonProperty("ImageID")
        private String imageID;

        @JsonProperty("HostConfig")
        private HostConfig hostConfig;

        @JsonProperty("Id")
        private String id;

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public List<Mount> getMounts() {
            return mounts;
        }

        public void setMounts(List<Mount> mounts) {
            this.mounts = mounts;
        }

        public Long getSizeRw() {
            return sizeRw;
        }

        public void setSizeRw(Long sizeRw) {
            this.sizeRw = sizeRw;
        }

        public List<Port> getPorts() {
            return ports;
        }

        public void setPorts(List<Port> ports) {
            this.ports = ports;
        }

        public Map<String, String> getLabels() {
            return labels;
        }

        public void setLabels(Map<String, String> labels) {
            this.labels = labels;
        }

        public String getImage() {
            return image;
        }

        public void setImage(String image) {
            this.image = image;
        }

        public Long getCreated() {
            return created;
        }

        public Date getCreatedDate() {
            return created == null ? null : new Date(created * 1000);
        }

        public void setCreated(Long created) {
            this.created = created;
        }

        public List<String> getNames() {
            return names;
        }

        public void setNames(List<String> names) {
            this.names = names;
        }

        public NetworkSettings getNetworkSettings() {
            return networkSettings;
        }

        public void setNetworkSettings(NetworkSettings networkSettings) {
            this.networkSettings = networkSettings;
        }

        public Long getSizeRootFs() {
            return sizeRootFs;
        }

        public void setSizeRootFs(Long sizeRootFs) {
            this.sizeRootFs = sizeRootFs;
        }

        public String getCommand() {
            return command;
        }

        public void setCommand(String command) {
            this.command = command;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        public String getImageID() {
            return imageID;
        }

        public void setImageID(String imageID) {
            this.imageID = imageID;
        }

        public HostConfig getHostConfig() {
            return hostConfig;
        }

        public void setHostConfig(HostConfig hostConfig) {
            this.hostConfig = hostConfig;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public static class Mount {

            @JsonProperty("Destination")
            private String destination;

            @JsonProperty("Propagation")
            private String propagation;

            @JsonProperty("RW")
            private Boolean rW;

            @JsonProperty("Mode")
            private String mode;

            @JsonProperty("Driver")
            private String driver;

            @JsonProperty("Source")
            private String source;

            @JsonProperty("Name")
            private String name;

            public String getDestination() {
                return destination;
            }

            public void setDestination(String destination) {
                this.destination = destination;
            }

            public String getPropagation() {
                return propagation;
            }

            public void setPropagation(String propagation) {
                this.propagation = propagation;
            }

            public Boolean getrW() {
                return rW;
            }

            public void setrW(Boolean rW) {
                this.rW = rW;
            }

            public String getMode() {
                return mode;
            }

            public void setMode(String mode) {
                this.mode = mode;
            }

            public String getDriver() {
                return driver;
            }

            public void setDriver(String driver) {
                this.driver = driver;
            }

            public String getSource() {
                return source;
            }

            public void setSource(String source) {
                this.source = source;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }
        }

        public static class Port {

            @JsonProperty("IP")
            private String ip;

            @JsonProperty("Type")
            private String type;

            @JsonProperty("PrivatePort")
            private Long privatePort;

            @JsonProperty("PublicPort")
            private Long publicPort;

            public String getIp() {
                return ip;
            }

            public void setIp(String ip) {
                this.ip = ip;
            }

            public String getType() {
                return type;
            }

            public void setType(String type) {
                this.type = type;
            }

            public Long getPrivatePort() {
                return privatePort;
            }

            public void setPrivatePort(Long privatePort) {
                this.privatePort = privatePort;
            }

            public Long getPublicPort() {
                return publicPort;
            }

            public void setPublicPort(Long publicPort) {
                this.publicPort = publicPort;
            }
        }

        public static class NetworkSettings {

            @JsonProperty("Networks")
            private Map<String, Network> networks;

            public Map<String, Network> getNetworks() {
                return networks;
            }

            public void setNetworks(Map<String, Network> networks) {
                this.networks = networks;
            }

            public static class Network {

                @JsonProperty("Gateway")
                private String gateway;

                @JsonProperty("GlobalIPv6Address")
                private String globalIPv6Address;

                @JsonProperty("EndpointID")
                private String endpointID;

                @JsonProperty("IPPrefixLen")
                private Long iPPrefixLen;

                @JsonProperty("IPv6Gateway")
                private String iPv6Gateway;

                @JsonProperty("GlobalIPv6PrefixLen")
                private Long globalIPv6PrefixLen;

                @JsonProperty("NetworkID")
                private String networkID;

                @JsonProperty("IPAddress")
                private String iPAddress;

                @JsonProperty("MacAddress")
                private String macAddress;

                public String getGateway() {
                    return gateway;
                }

                public void setGateway(String gateway) {
                    this.gateway = gateway;
                }

                public String getGlobalIPv6Address() {
                    return globalIPv6Address;
                }

                public void setGlobalIPv6Address(String globalIPv6Address) {
                    this.globalIPv6Address = globalIPv6Address;
                }

                public String getEndpointID() {
                    return endpointID;
                }

                public void setEndpointID(String endpointID) {
                    this.endpointID = endpointID;
                }

                public Long getiPPrefixLen() {
                    return iPPrefixLen;
                }

                public void setiPPrefixLen(Long iPPrefixLen) {
                    this.iPPrefixLen = iPPrefixLen;
                }

                public String getiPv6Gateway() {
                    return iPv6Gateway;
                }

                public void setiPv6Gateway(String iPv6Gateway) {
                    this.iPv6Gateway = iPv6Gateway;
                }

                public Long getGlobalIPv6PrefixLen() {
                    return globalIPv6PrefixLen;
                }

                public void setGlobalIPv6PrefixLen(Long globalIPv6PrefixLen) {
                    this.globalIPv6PrefixLen = globalIPv6PrefixLen;
                }

                public String getNetworkID() {
                    return networkID;
                }

                public void setNetworkID(String networkID) {
                    this.networkID = networkID;
                }

                public String getiPAddress() {
                    return iPAddress;
                }

                public void setiPAddress(String iPAddress) {
                    this.iPAddress = iPAddress;
                }

                public String getMacAddress() {
                    return macAddress;
                }

                public void setMacAddress(String macAddress) {
                    this.macAddress = macAddress;
                }
            }
        }

        public static class HostConfig {

            @JsonProperty("NetworkMode")
            private String networkMode;

            public String getNetworkMode() {
                return networkMode;
            }

            public void setNetworkMode(String networkMode) {
                this.networkMode = networkMode;
            }
        }
    }
}
